package com.zhuss.controller.intention;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.intention.intention.CreatePersonalIntentionBo;
import com.zhuss.bean.bo.intention.intention.DeletePersonalIntentionBo;
import com.zhuss.bean.bo.intention.intention.UpdatePersonalIntentionBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.OperateService;
import com.zhuss.intention.intention.PersonalIntentionOperateServiceExt;
import com.zhuss.exception.DzcxException;


/**
 * @description: 个人需求操作的Controller
 * @author: zhushanshuo
 * @create: Fri Dec 25 09:39:45 CST 2020
 **/
@RestController
@RequestMapping("/personalIntention")
public class PersonalIntentionOperateController extends BaseController {
	
	@Autowired
	@Qualifier("personalIntentionOperateService")
	private OperateService<Void, Object> personalIntentionOperateService;
	
	@Autowired
	@Qualifier("personalIntentionOperateServiceExt")
	private PersonalIntentionOperateServiceExt personalIntentionOperateServiceExt;
	
	/**
	 * 创建
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/create")
    public void create(@RequestBody CreatePersonalIntentionBo bo) throws DzcxException {
		
		personalIntentionOperateService.create(bo);
    }
	
	
	/**
	 * 修改
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/update")
    public void update(@RequestBody UpdatePersonalIntentionBo bo) throws DzcxException {
		
		personalIntentionOperateService.update(bo);
    }
	
	/**
	 * 删除
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/delete")
    public void delete(@RequestBody DeletePersonalIntentionBo bo) throws DzcxException {
		
		personalIntentionOperateService.delete(bo);
    }
	
}
